function image = rastercircle(x0,y0,r,image,amount)
    [sx,sy] = size(image);
    f = 1 - r;
    ddF_x = 1;
    ddF_y = -2 * r;
    x = 0;
    y = r;
    
    if x0 > 0 & x0 < sx & y0+r > 0 & y0+r <= sy
        image(x,y) = image(x,y) + amount;
    end
    
    image = setPixel(image,x0,y0+r,amount);
    image = setPixel(image,x0,y0-r,amount);
    image = setPixel(image,x0+r,y0,amount);
    image = setPixel(image,x0-r,y0,amount);
    while x < y
        if f > 0
            y = y - 1;
            ddF_y = ddF_y + 2;
            f = f + ddF_y;
        end
        x = x + 1;
        ddF_x = ddF_x + 2;
        f = f+ddF_x;
        image = setPixel(image,x0+x,y0+y,amount);
        image = setPixel(image,x0-x,y0+y,amount);
        image = setPixel(image,x0+x,y0-y,amount);
        image = setPixel(image,x0-x,y0-y,amount);
        image = setPixel(image,x0+y,y0+x,amount);
        image = setPixel(image,x0-y,y0+x,amount);
        image = setPixel(image,x0+y,y0-x,amount);
        image = setPixel(image,x0-y,y0-x,amount);
    end
end

function image = setPixel(image,x,y,amount)
    [sx sy] = size(image);
    if x > 0 & x < sx & y > 0 & y <= sy
        image(x,y) = image(x,y) + amount;
    elseif x > sx & y > sy
    elseif x > sx
    end
end